
<extend name="Common/common" />

<block name="content" >
<article class="page-container">
	<form method="post" action="{:U('Blog/add')}" class="form form-horizontal" id="form-article-add">
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>文章标题：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="{$blog['title']}" placeholder="" id="articletitle" name="title">
			</div>
		</div>
		
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>分类栏目：</label>
			<div class="formControls col-xs-8 col-sm-2"> <span class="select-box">
				<select name="cat_id" class="select">
					<option value="0">全部栏目</option>
					<foreach name="cats" item="v">
					<option value="{$v['cat_id']}" <if condition='$v["cat_id"]==$blog["cat_id"]'>selected</if> >{$v['cat_name']}</option>
					</foreach>
				</select>
				</span> </div>
		</div>
		
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">文章来源：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="{$blog['source']}" placeholder="" id="sources" name="source">
			</div>
		</div>
		
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">博客发布时间：</label>
			<div class="formControls col-xs-8 col-sm-2">
				<input name="time" type="text" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" id="datemin" readonly value="<if condition="empty($blog['time'])">{$time|date='Y-m-d H:i:s',###}<else/>{$blog['time']|date='Y-m-d H:i:s',###}</if>" class="input-text Wdate" style="width:180px;">
			</div>
		</div>
		
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">文章内容：</label>
			<div class="formControls col-xs-8 col-sm-9"> 
				<script name='content' id="editor" type="text/plain" style="width:100%;height:400px;">{$blog['content']}</script> 
			</div>
		</div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
				<input type="hidden" name="id" value="<if condition="empty($_GET['id'])">0<else/>{$_GET['id']}</if>"/>
				<button class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 提交</button>
			</div>
		</div>
	</form>
</article>

<script type="text/javascript">
$(function(){
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	$("#form-article-add").validate({
		rules:{
			title:{
				required:true,
				minlength:2,
				maxlength:16
			},
			
		},
		onkeyup:false,
		focusCleanup:true,
		success:"valid",
		
	});
	var ue = UE.getEditor('editor');
	
});
</script>
<!--/请在上方写此页面业务相关的脚本-->
</block>